Rails.application.routes.draw do
  namespace :api do
    namespace :v1 do
      resources :sessions
      resources :users
      resources :games
      resources :bets
      resources :plans do
        collection do
          get :sum
        end
      end
      resources :teams
    end
  end

  namespace :admin do
    resources :admins
    resources :settings
    resources :sessions
    resources :users
    resources :teams
    resources :league_games
    resources :games
    resources :home

    get 'register', to: 'admins#new'
    get 'login', to: 'sessions#new'
    root "home#index"
  end

  mount ExceptionTrack::Engine => "/exception-track"
end
